package com.study.mike.spring.sample.aop;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.support.GenericXmlApplicationContext;

public class AopAnnotationTest {
	ApplicationContext context;
	@Before
	public void prepare() {
//		context = new GenericXmlApplicationContext(
//				"classpath:com/study/mike/spring/sample/aop/application2.xml");

		context = new AnnotationConfigApplicationContext("com.study.mike.spring.sample.aop");
	}

	@Test
	public void test() {
		TargetBean targetBean = context.getBean(TargetBean.class);
		System.out.println(targetBean.exec("task1", 2));

//		targetBean.do1("task1", 20);
//		System.out.println();
//
//		targetBean.service1("service1");
//
//		System.out.println();
//		targetBean.service2("ssss");
	}
}
